package com.yn.pet.controller.pc;

import com.yn.common.annotation.Anonymous;
import com.yn.common.constant.Constants;
import com.yn.common.core.controller.BaseController;
import com.yn.common.core.domain.AjaxResult;
import com.yn.common.exception.ServiceException;
import com.yn.pet.controller.app.biz.AppUserBizService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotBlank;

@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/device-manager")
public class DeviceManagerController extends BaseController {

    private final AppUserBizService appUserBizService;

//    /**
//     * 手表同步用户信息接口
//     * @param userJson
//     * @return
//     */
//    @Anonymous
//    @ApiOperation("同步其他平台用户信息")
//    @PostMapping("/sync-user")
//    public AjaxResult syncUser(@RequestParam(name = "secretKey",required = true)@ApiParam(value = "自定义密钥",required = true) @NotBlank(message = "请填写密钥") String secretKey,
//                            @RequestParam(name = "userJson",required = true)@ApiParam(value = "用户信息json",required = true)@NotBlank(message = "请填写用户信息") String userJson){
//        log.info("DeviceManagerController -> syncUser input params：secretKey:{} userJson:{}",secretKey,userJson);
//        if (!StringUtils.equals(secretKey, Constants.SECRET_KEY)) {
//            throw new ServiceException("密钥错误");
//        }
//        return appUserBizService.syncUser(userJson);
//    }
}
